﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace KingerRobot.MexicoSailunMDC.SpiService;

public class BMonitor : IMonitor
{

    IMonitorManage _Monitor = new BMonitorManage();


    /// <summary>
    /// 记录流程日志
    /// </summary>
    /// <param name="logType">日志类型  1 入库 2 出库</param>
    /// <param name="logIndex">流程顺序</param>
    /// <param name="barcode">条码</param>
    /// <param name="logInfo">关键信息</param>
    /// <param name="logMsg">日志消息</param>
    /// <returns></returns>
    public int CreateFlowLog(int logType, int logIndex, string barcode, string logInfo, string logMsg)
    {

        var db = Db.Default;

        POMonitorFlowLogs pOMonitorFlowLogs = new POMonitorFlowLogs();
        pOMonitorFlowLogs.Id = XID.Nextval;
        pOMonitorFlowLogs.barcode = barcode;
        pOMonitorFlowLogs.LogMsg = logMsg;
        pOMonitorFlowLogs.LogIndex = logIndex;
        pOMonitorFlowLogs.LogInfo = logInfo;
        pOMonitorFlowLogs.LogIndex = logIndex;
        db.Add(pOMonitorFlowLogs);
        return db.SaveChanges();

    }

    public CuringListBeans GetCuringNodesByEquipId(long equipId)
    {
        var result = _Monitor.GetCuringNodesByEquipId(equipId);
        return result;

    }
}
public class CuringNodeParam
{
    public long? EquipId { get; set; }
}